package com.ruoyi.partybuilding.domain;

import com.easy.query.core.basic.extension.logicdel.LogicDeleteStrategyEnum;
import com.ruoyi.partybuilding.common.EQuery.CU2Entity;
import com.ruoyi.partybuilding.common.EQuery.EQueryEntityLong;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import com.easy.query.core.annotation.*;

/**
 * 商品;
 * @author : He-LiangLiang@Outlook.com
 * @date : 2025-1-24
 */
@ApiModel(value = "商品",description = "")
@Table("pb_mall_goods")
@Data
public class MallGoods extends CU2Entity.LongId {

    /** 名称 */
    @ApiModelProperty(value = "名称",notes = "")
    @EasyWhereCondition
    private String name ;
    /** 小标题 */
    @ApiModelProperty(value = "小标题",notes = "")
    private String subtitle ;
    /** 分类 */
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @ApiModelProperty(value = "分类",notes = "")
    private String category ;
    /** 价格 */
    @ApiModelProperty(value = "价格",notes = "")
    private Double price ;
    /** 数量 */
    @ApiModelProperty(value = "数量",notes = "")
    private Integer quantity ;
    /** 图片 */
    @ApiModelProperty(value = "图片",notes = "")
    private String img ;
    /** 详情描述 */
    @ApiModelProperty(value = "详情描述",notes = "")
    private String content ;

    @LogicDelete(strategy = LogicDeleteStrategyEnum.DELETE_LONG_TIMESTAMP)
    private Long deleted;

    @ApiModelProperty(value = "排序",notes = "")
    Integer sort;
    @ApiModelProperty(value = "状态",notes = "状态：0下架，1正常")
    Integer status;

    public void quantitySetBy(Integer changeNum) {
        setQuantity(quantity - changeNum);
    }


}